package idu0080.openerp.server;

import java.util.ResourceBundle;

public class OpenERPServerConnectionData 
{
	private String host;
	private int port;
	private String database;
	private String username;
	private String password;
	
	private final String OPEN_ERP_SERVER_CONNECTION_PROPERTIES_FILE_NAME = "open_erp_server_connection";
	private final String OPEN_ERP_HOST_PROP_NAME = "open_erp_host";
	private final String OPEN_ERP_PORT_PROP_NAME = "open_erp_port";
	private final String OPEN_ERP_DATABASE_PROP_NAME = "open_erp_database";
	private final String OPEN_ERP_USERNAME_PROP_NAME = "open_erp_username";
	private final String OPEN_ERP_PASSWORD_PROP_NAME = "open_erp_password";
	
	public OpenERPServerConnectionData() 
	{
		ResourceBundle resourceBundle = ResourceBundle.getBundle(OPEN_ERP_SERVER_CONNECTION_PROPERTIES_FILE_NAME);
		this.host = resourceBundle.getString(OPEN_ERP_HOST_PROP_NAME);
		this.port = Integer.parseInt(resourceBundle.getString(OPEN_ERP_PORT_PROP_NAME));
		this.database = resourceBundle.getString(OPEN_ERP_DATABASE_PROP_NAME);
		this.username = resourceBundle.getString(OPEN_ERP_USERNAME_PROP_NAME);
		this.password = resourceBundle.getString(OPEN_ERP_PASSWORD_PROP_NAME);
	}

	public String getHost() 
	{
		return host;
	}

	public void setHost(String host) 
	{
		this.host = host;
	}

	public int getPort() 
	{
		return port;
	}

	public void setPort(int port) 
	{
		this.port = port;
	}

	public String getDatabase() 
	{
		return database;
	}

	public void setDatabase(String database) 
	{
		this.database = database;
	}

	public String getUsername() 
	{
		return username;
	}

	public void setUsername(String username) 
	{
		this.username = username;
	}

	public String getPassword() 
	{
		return password;
	}

	public void setPassword(String password) 
	{
		this.password = password;
	}
}
